import { Request } from '@/utils/request';

const url = {
    getDetail: "/paper/detail",
    getComments: "/paper/comment/list",
    topComment: "/paper/comment/top",
    reportComment: "/paper/comment/report",
    deleteComment: "/paper/comment/delete",
    publishComment: "/paper/comment/publish",
    relatedTree: "/paper/related",
    paperPreview: "/paper/preview",
    paperQuote: "/paper/quote"
};

export const paper = {
    // 获取论文简介
    getDetail: function (params: any) {
        return Request.axiosInstance({
            url: url.getDetail,
            method: 'get',
            params: params
        })
    },
    // 获取论文评论
    getComments: function (params: any) {
        return Request.axiosInstance({
            url: url.getComments,
            method: 'get',
            params: params
        })
    },
    // 置顶/取消置顶论文评论
    topComment: function (params: any) {
        return Request.axiosInstance({
            url: url.topComment,
            method: 'post',
            data: params
        })
    },
    // 投诉论文评论
    reportComment: function (params: any) {
        return Request.axiosInstance({
            url: url.reportComment,
            method: 'post',
            data: params
        })
    },
    // 删除论文评论
    deleteComment: function (params: any) {
        return Request.axiosInstance({
            url: url.deleteComment,
            method: 'post',
            data: params
        })
    },
    // 发表论文评论
    publishComment: function (params: any) {
        return Request.axiosInstance({
            url: url.publishComment,
            method: 'post',
            data: params
        })
    },
    // 获取相关论文树
    relatedTree: function (params: any) {
        return Request.axiosInstance({
            url: url.relatedTree,
            method: 'get',
            params: params
        })
    },
    // 获取论文预览地址
    paperPreview: function (params: any) {
        return Request.axiosInstance({
            url: url.paperPreview,
            method: 'get',
            params: params
        })
    },
    // 获取论文引用格式
    paperQuote: function (params: any) {
        return Request.axiosInstance({
            url: url.paperQuote,
            method: 'get',
            params: params
        })
    },
}